<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:71:"/var/www/dangan_new/public/../application/index/view/Prearc/upload.html";i:1547548513;}*/ ?>
<!-- 这里是上传文件的页面 -->
<!DOCTYPE html>
<html lang="en">
<head> 
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		@charset "utf-8";
		body {
			color: #000;
			line-height: 166.6%;
			float: left;
			font-family: verdana;
			font-size: 12px;
		}

		ul,ol {
			list-style: none;
		}

		ul,ol,li,img {
			border: 0 none;
			margin: 0;
			padding: 0;
		}

		.stream-browse-files {
			overflow: hidden;
			position: relative;
		}

		.stream-browse-drag-files-area {
			border: 2px dashed #555;
			padding: 10px 0;
			border-radius: 7px;
			text-align: center;
			margin: 10px 0;
			cursor: pointer;
		}

		.stream-disable-browser {
			color: #909090;
		}

		.stream-files-scroll {
			height: 450px;
			overflow: auto;
		}

		.stream-cell-file {
			cursor: default;
			position: relative;
			zoom: 1;
			padding: 10px 20px 10px 35px;
			border-bottom-width: 1px;
			border-bottom-style: dotted;
			border-color: #ccc;
		}

		.stream-cell-file .stream-cell-infos:before,.stream-cell-file .stream-cell-infos:after {
			clear: both;
			content: ".";
			font-size: 0;
			display: block;
			height: 0;
			overflow: hidden;
			visibility: hidden;
		}

		.stream-cell-file .stream-file-name {
			width: 100%;
			overflow: hidden;
			text-overflow: ellipsis;
		}

		.stream-cell-file .stream-process {
			zoom: 1;
			overflow: hidden;
		}

		.stream-cell-file .stream-cancel {
			margin-right: 5px;
			float: right;
		}

		a {
			color: #158144;
		}

		.stream-cell-file .stream-process-bar {
			width: 300px;
		}

		.stream-cell-file .stream-process-bar,.stream-cell-file .stream-percent {
			float: left;
			margin-right: 10px;
		}

		.stream-cell-file .stream-process-bar {
			margin-top: 5px;
			width: 430px;
		}

		.stream-process-bar {
			position: relative;
			border: 1px solid #ccc;
			background: #fff;
			width: 55px;
			height: 10px;
			overflow: hidden;
		}

		.stream-process-bar span {
			position: absolute;
			left: 0;
			top: 0;
			height: 8px;
			border: 1px solid #fff;
			font-size: 0;
			background-position: 0 -149px;
			background-repeat: repeat-x;
			background-color: #A5DD3D;
		}

		.stream-process-bar,.stream-process-bar span {
			-moz-box-sizing: border-box;
			-webkit-box-sizing: border-box;
			-khtml-box-sizing: border-box;
			box-sizing: border-box;
		}

		.stream-cell-file .stream-cell-infos {
			zoom: 1;
			color: #7D7D7D;
		}

		.stream-cell-file .stream-cell-infos .stream-cell-info {
			width: 170px;
		}

		.stream-cell-file .stream-cell-infos span {
			float: left;
			margin-right: 8px;
		}

		.stream-total-tips .stream-process-bar {
			width: 200px;
			margin-top: -1px;
		}

		.stream-process-bar, .stream-uploading-ico {
			-moz-box-align: center;
			display: inline-block;
			vertical-align: middle;
			zoom: 1;
		}

		.stream-total-tips {
			border: 1px solid #ccc;
			border-width: 1px 0 0;
			padding: 3px 5px 3px 25px;
			position: relative;
			zoom: 1;
			background-color: #FFFFE1;
			color: #565656;
		}

		.stream-main-upload-box {
			width: 610px;
			background-color: #FFFFFF;
			border-style: solid;
			border-width: 1px;
			border-color: #50A05B;
			clear: both;
			overflow: hidden;
		}

		.stream-uploading-ico {
			left: 11px;
			position: absolute;
			top: 11px;
			height: 18px;
			width: 18px;
		}

		.stream-disabled {
			cursor: not-allowed;
			pointer-events: none;
			opacity: .65;
			filter: alpha(opacity=65);
			-webkit-box-shadow: none;
			box-shadow: none;
		}
	</style>
</head>

<script src="/static/assets/scripts/core/stream-v1.js" type="text/javascript"></script>
<!-- 引入了js逻辑 -->
<!-- <button class="dianji" onclick="dianji()">aaaaaaa</button> -->
<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
			<h4 class="modal-title">上传文件</h4>
		</div>
		<div class="modal-body">
			<div id="i_select_files" style="width: 100%;">
			</div>
			<div id="i_stream_files_queue" style="width: 100%;">
			</div>
		</div>
		<div class="modal-footer">
			<button onclick="javascript:_t.upload();" class="btn btn-success">开始上传</button>
			<button onclick="javascript:_t.stop();" class="btn btn-danger">停止上传</button>
			<button onclick="javascript:_t.cancel();" class="btn btn-primary ">取消</button>
			<button type="button" class="btn default model1close" data-dismiss="modal">关闭</button>
		</div>

	</div>
</div>

<script src="/static/assets/js/toastr.min.js" rel="stylesheet"/></script>
<link href="/static/assets/css/toastr.min.css" rel="stylesheet"/>

<script src="/static/assets/plugins/jstree/dist/jstree.min.js"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script src="/static/assets/scripts/custom/ui-tree.js"></script>
<script src="/static/assets/scripts/core/app.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/plugins/jstree/dist/themes/default/style.min.css"/>
<script src="/static/assets/scripts/core/dt.js"></script>

<script type="text/javascript">
	 // dt().modalSave();
     
    //      jQuery(document).ready(function() {
    //     App.init();
    //     UITree.init();
       
    // });
    var config = {
        browseFileId : "i_select_files", /** 选择文件的ID */
        browseFileBtn : "<div>请选择文件</div>", /** 显示选择文件的样式 */
        dragAndDropArea: "i_select_files", /** 拖拽上传区域 */
        dragAndDropTips: "<span>把文件(文件夹)拖拽到这里</span>", /** 拖拽提示 */
        filesQueueId : "i_stream_files_queue", /** 文件上传容器的ID */
        filesQueueHeight : 200, /** 文件上传容器的高度（px）, 默认: 450 */
        multipleFiles: true, /** 多文件上传, 默认: false */
        autoUploading: false, /** 选择文件后是否自动上传, 默认: true */
        tokenURL : "<?php echo url('index/Prearc/uploadfile'); ?>?action=tk&cate_type=1", /** 根据文件名、大小等信息获取Token的URI（用于生成断点续传、跨域的令牌） */
        uploadURL : "<?php echo url('index/Prearc/uploadfile'); ?>?action=up&cate_type=1", /** HTML5上传的URI */
        onSelect: function(list) {
		  console.log("select files: " + list.length);
		  for (var i=0; i < list.length; i++) {
		      console.log("file name: "
		       + list[i].name
		       + " file size:"
		       + list[i].size);
		  }
		},
        onQueueComplete:function (msg) {

            dt().alertSuccess('modal-dialog','success','上传成功','',true);

            window.location.reload();

  //       	var treeq = JSON.parse(msg).tree;
  //       	var idq = JSON.parse(msg).id;
  //       	// console.log(msg,msg.id);
  //       	console.log(idq);

  //       	var url = "<?php echo url('index/Common/removedata'); ?>";

  //       	dt().modalSave();

  //       	$(function () {
	 //        App.init();
	 //        UITree.init();

	 //        $("#tree_1").on('changed.jstree', function (e, data) {
	 //            var id = data.node.data.id;
	 //            $('.new_cate').val(id);
	 //            return false;
	 //        });
	 //    })
  //       	// window.location.href="<?php echo url('index/Prearc/remove'); ?>?id="+idq;

  //       	if(idq){
  //                   url = url+'?id='+idq;
  //               }
  //               $.get(url,function(res){
  //                       // console.log(res);
  //                   if(isJSON(res)){
  //                       res = JSON.parse(res);
  //                       $('#model1').html('<div class="modal-dialog"></div>');
  //                       dt().alertSuccess('modal-dialog','danger',res.msg,'',false);
  //                       return false;
  //                   }else {
  //                   	console.log(res);
  //                       $('#model1').html(res);
  //               		$('#model1').modal('show');
  //               		// return false;
  //                   }
  //               });

  //               // return false;
                
  //           function isJSON(str) {
		//     if (typeof str == 'string') {
		//         try {
		//             JSON.parse(str);
		//             return true;
		//         } catch(e) {
		//             console.log(e);
		//             return false;
		//         }
		//     }
		//     console.log('It is not a string!')
		// }

		/*if(reload == undefined){
                reload = true;
            }
            $('.save').click(function(){
                var form = $('.modalForm');
                // console.log(form.attr('action'));
                $.ajax({
                    url: form.attr('action'),
                    type:form.attr('method'),
                    data:form.serialize(),
                    dataType:'json',
                    success:function (e) {
                        if(e.code ==1){
                            dt().alertSuccess('modal-dialog','success',e.msg,'',true)
                        }else{
                            dt().alertSuccess('modal-dialog','danger',e.msg,'',false)
                        }
                    }
                });
                return false;
            });
             dt().alertSuccess('modal-dialog','success','上传成功','',false);*/
		// window.open(url);
        // // 	$('.modal-dialog').html();
        // // 	 // $('#model1').modal('hide');
        // //     // $('#tree_1').css('display',block);
        	 // $('.modal-dialog').css('display','block');
          //   		$('#tree_1').html(treeq);
        //     var id = msg.id;
        //     $.ajax({
        //     	type : 'POST',
        //     	url : "<?php echo url('index/Prearc/remove'); ?>",
        //     	data : id,
        //     	success : function (data) {
        //     		console.log(data);
        //     $('#tree_1').html(data.tree);
        //     		// window.location.href="<?php echo url('index/Prearc/remove'); ?>";
        //     	}
        //     });
        },
        onUploadError: function(status, msg) {
			  console.log("上传文件出错，代码：" + status
			   + "|错误：" + msg);
			}
    };
    
    var _t = new Stream(config);
</script>



</html>